package com.kay.json;

import javax.json.bind.annotation.*;

/**
 * @author Kay
 * @Date: 2019/11/28 18:30
 */

@SuppressWarnings({"unused", "WeakerAccess"})
public class StudentDTO {

    private int id;

    // 姓名
    @JsonbProperty("姓名")
    private String name;

    // 年龄
    @JsonbTransient
    private int age;

    // 为了使用jsonb,必须有一个空的默认构造方法
    public StudentDTO() {

    }

    public StudentDTO(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}